﻿using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZuesUI.Models;

namespace ZuesUI.ViewModels
{
    public class TreeListViewViewModel:BindableBase
    {
        public TreeListViewModel model = new TreeListViewModel() { Name = "父级", Address = "列1" };
        public TreeListViewModel model2 = new TreeListViewModel() { Name = "父级", Address = "列1" };
        public TreeListViewModel model3 = new TreeListViewModel() { Name = "父级", Address = "列1" };

        public TreeListViewViewModel() 
        {

            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model.Children.Add(new TreeListViewModel() { Name = "子级", Address = "子级列1" });
            model2.Children.Add(model3);
            model2.Children.Add(model3);
            model2.Children.Add(model3);
            model2.Children.Add(model3);
            model.Children.Add(model2);
            for (int i = 0; i < 1000; i++)
            {
                model2.Children.Add(model3);
            }

            TreeList = new ObservableCollection<TreeListViewModel>();
            TreeList.Add(model);
        }

        private ObservableCollection<TreeListViewModel> _treeList = new ObservableCollection<TreeListViewModel>();

        public ObservableCollection<TreeListViewModel> TreeList
        {
            get { return _treeList; }
            set
            {
                SetProperty(ref _treeList, value);
            }
        }



    }
}
